<?php if(!defined('DB_NAME')) die(); get_header();
//判断是否手机
if( ismobile() && $obj_key  ==$ini_key ):
	include "mp/single.php";
else:
//判断是否包含媒体分享链接
if( ismedia() && $obj_key == $ini_key ):
	include "inc/msingle.php";
else:
?>

	<div id="content">
		<div class="main">
<?php ini_map()?>
			<div class="article">
<?php
while(have_posts()): the_post();
if ( get_the_author_meta('ggplus')!="" ) echo "<a href=\"https://plus.google.com/".get_the_author_meta('ggplus')."?rel=author\"></a>\n";
?>
				<h2 class="entry-title" property="v:title"><?php the_title()?></h2>

<header class="post-header">
<?php if( get('ini_author')=='隐藏' ){ ?>
		<span><i class="icon-user"></i><a href="<?php echo get_author_posts_url( $authordata->ID )?>">&nbsp;<?php the_author('nickname')?></a></span>
<?php }?>
		<?php if(get('ini_rate')) fancyratings()?>
<?php
if ( (get_the_modified_time('Y')*365+get_the_modified_time('z')) > (get_the_time('Y')*365+get_the_time('z')) ){   # 判断文章是否更新过
?>
		<span class="date updated hide"><?php the_modified_time('Y/m/d H:i')?></span>
		<span>
<?php } else { ?>
		<span class="date updated">
<?php }?>
			<time property="v:datePublished" datetime="<?php the_modified_time('Y-m-d')?>">
				<abbr class="tip" title="最后更新: <?php the_modified_time('n月, j日, Y年 H:i, l')?>" style="cursor:help"><i class="icon-time"></i>&nbsp;<?php the_time('Y-m-d')?></abbr>
			</time>
		</span>
		<span><i class="icon-eye-open"></i>&nbsp;<?php echo get_post_views($post->ID)?> ℃</span>
		<span><i class="icon-comment"></i>&nbsp;<a href="<?php the_permalink()?>#comments"><?php echo get_post($post->ID)->comment_count?>条点评</a></span>
		<span><?php edit_post_link('编辑文章','<i class="icon-edit"></i> ')?></span>
<?php
if( get('ini_font_size') && $obj_key ==$ini_key ){
	echo '	<div class="font-size"><span class="font-small bd">小号字体</span><span class="font-middle bd">中号字体</span><span class="font-large bd">大号字体</span></div>';
}
?>
</header>

<?php if (get('ini_ad3')) echo "<div class=\"ad3\">".get('ini_ad3_code')."</div>\n"; ?>
				<div class="context" property="v:description">
<?php
if ( !(ini_count($text))==0  && $obj_key  ==$ini_key ){    # 判断是否有文字
	echo '					<div class="excerpt ';
	if ( !get('ini_excerpt')||get('ini_excerpt')=='隐藏' ){   # 判断是否隐藏摘要，其实还是有作为微数据输出
		echo 'hide';
	}
	echo '">';
	ini_excerpt(150);
	echo "</div>\n";
}
the_content();
?>
				</div><?php#end context?> 
				<?php post_page()?> 
				<div class="tag">本文标签：<?php echo i_tags()?></div>
				<?php ini_bdshare()?> 
				<?php if( get('ini_ad4') ) echo "<div class=\"ad4\">".get('ini_ad4_code')."</div>"; ?> 
				<div class="post-nav">
					<div class="post-prev">
<?php
$prev_post = get_previous_post();
echo get_previous_post()? '						<i class="icon-double-angle-left"></i><a href="'.wp_get_shortlink( $prev_post->ID ).'">'.$prev_post->post_title.'</a>': '';
?>
					</div>
					<div class="post-next">
<?php
$next_post = get_next_post();
echo get_next_post()? '						<a href="'.wp_get_shortlink( $next_post->ID ).'">'.$next_post->post_title.'</a><i class="icon-double-angle-right"></i>':
'						如果给等待加一个期限，你希望是多久...';
?>
					</div>
					<small class="clear"></small>
				</div>
			</div><?php#end article?> 
<?php if( get('ini_copyright')=='显示' ){ echo feed_copyright(); }?> 
<?php if( get('ini_author')=='显示' && $obj_key== $ini_key ){?>
			<section class="post-meta author-info" itemscope itemtype="http://data-vocabulary.org/Person">
				<div class="m-t">本文小编</div>
				<?php echo get_avatar( get_the_author_email(), 60 )?>
				<a class="fn" itemprop="name" href="<?php echo get_author_posts_url( $authordata->ID )?>" rel="external"><?php the_author('nickname')?></a><br>
				<p><?php echo the_author_meta( 'description' )?></p>
				<p>
<?php
if( get_the_author_meta('org')!="" ) echo "					公司: <span itemprop='affiliation'>".get_the_author_meta('org')."&nbsp;&nbsp;</span>\n";
if( get_the_author_meta('irole')!="" ) echo "					职位: <span itemprop='role'>".get_the_author_meta('irole')."&nbsp;&nbsp;</span>\n";
if( get_the_author_meta('weibo')!="" ) echo "					<a href='".get_the_author_meta('weibo')."' rel='external'>新浪微博&nbsp;&nbsp;</a>\n";
if( get_the_author_meta('tweibo')!="" ) echo "					<a href='".get_the_author_meta('tweibo')."' rel='external'>腾讯微博&nbsp;&nbsp;</a>\n";
?>
					邮箱: <a href="mailto:<?php the_author_email()?>" rel="external"><?php the_author_email()?></a>
				</p>
			</section>
<?php }?> 
<?php include "inc/related.php"?>
		</div><?php#end main?>
<?php if('open'== $post->comment_status){?>
		<div class="main">
			<?php comments_template()?> 
		</div>
<?php }?>
<?php endwhile?> 
	</div><?php#end content?> 
<?php if(!get('ini_single')) get_sidebar()?>
<?php endif;#ismedia?>
<?php endif;#ismobile?>
<?php get_footer()?>